package com.victor.common.constant.state;

/**
 * 是否推荐
 */
public enum IsTop {
    Y("y", "推荐"), N("n", "不推荐");
    private String code;
    private String message;

    IsTop(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessageByCode(String code) {
        if (code == null) {
            return "";
        } else {
            for (IsTop s : IsTop.values()) {
                if (s.getCode().equals(code)) {
                    return s.getMessage();
                }
            }
            return "";
        }
    }
}
